import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

import CarBookingForm from '../components/CarBookingForm.vue'
import EnrollList from '../components/EnrollList.vue'
import PrivacyPolicy from '@/views/PrivacyPolicy.vue'

const routers = [
  {
    path: '/',
    component: CarBookingForm,
  },
  {
    path: '/admin',
    component: EnrollList
  },
  {
    path: '/privacy-policy',
    name: 'PrivacyPolicy',
    component: PrivacyPolicy
  },
  {
    path: '/smart',
    name: 'smart',
    component: () => import('@/views/smart/SmartIndex.vue') 
  }
]

// 路由配置
const RouterConfig = {
  mode: "history",
  routes: routers,
};

const createRouter = () => new VueRouter(RouterConfig);

export const router = createRouter();
